<template>
  <div class="header">
    <div class="back" @click="$router.back()"><van-icon name="arrow-left" size="14px" /></div>
    <div class="title">{{ title }}</div>
    <div class="menu">...</div>
  </div>
</template>

<script>
export default {
  name: 'Header',
  data () {
    return {
      title: ''
    }
  },
  watch: {

    $route: {
      handler: function (newVal) {
        this.title = newVal.meta.title
      },
      immediate: true
    }
  }
}
</script>

<style lang="less" scoped>
.header {
    height: 36px;
    line-height: 36px;
    border-bottom: 1px solid #eaeaea;
    text-align: center;
    background:#6bd3b2;
    color: #FAFAFA;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    padding: 0 8px;
  }
  .back {
    height: 80%;
    margin-top: 3px;
  }
  .title {
    flex: 1;
  }
</style>
